/*************************************************************************
> File Name: main.c
> Author: icebear
> Mail: 3322366195@qq.com
> Created Time: 2023-07-29 16:19:38
> Description: 函数返回值使用+= 的情况 一条语句解决2的n次幂 malloc分配0空间
************************************************************************/

#include <stdio.h>

int modifyvalue(int x)
{
    return (x += 10);
}
int changevalue(int x)
{
    return (x += 1);
}
int main(int argc, char const *argv[])
{
    int x = 10;
    x++;            // x=11
    changevalue(x); // x=12
    x++;
    modifyvalue(x);
    printf("First output:%d\n", x);
    x++;
    changevalue(x);
    printf("Second output:%d\n", x);
    modifyvalue(x);
    printf("Third output:%d\n", x);
    int a;
    scanf("%d", &a);
    printf("%c", (a) & (a - 1) ? 'n' : 'y');
    printf("%d", a);
    //  若是打印y，否则n
    char *ptr;
    if ((ptr = (char *)malloc(0)) == NULL)
        puts("Got a null pointer");
    else
        puts("Got a valid pointer");

    return 0;
}
